#!/bin/bash

# Reload application cache
echo "Reloading application cache"
uicache

# Handle the daemon
echo "(Re)-loading daemon..."
chown root /Library/LaunchDaemons/jp.soh.reprovisiond.plist

# Unload for an upgrade. - Might spew an error, so hide that.
/bin/launchctl unload /Library/LaunchDaemons/jp.soh.reprovisiond.plist 2>/dev/null
/bin/launchctl load /Library/LaunchDaemons/jp.soh.reprovisiond.plist

# Classic easter egg
echo "Do, or do not. There is no try."